package com.example.controller;

import com.example.entity.Vip;
import com.example.globalException.DefineException;
import com.example.globalException.GlobalException;
import com.example.service.VipServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class WS {
    @Autowired
    private VipServiceImpl vipService;
    @GetMapping("/er")
    public String s() throws DefineException {
        int i=0;
           if(i==0){
               throw new DefineException("异常",50000);
           }
        return "true";
    }
    @GetMapping("/listvip")
    public List<Vip> listVip(){
        List<Vip> vips = vipService.listVip();
        return vips;
    }
}
